package com.neusoft.neuiotms.common.constant;

import java.util.Arrays;
import java.util.List;

/**
 * @author WYS
 * @date 2020年9月29日 下午3:22:24
 */
public enum StateEnum implements IDictionary {
    Invalid(1, "停用"),
    Valid(2, "启用");

    private int value;
    private String label;

    private StateEnum(final int value, final String label) {
        this.value = value;
        this.label = label;
    }

    @Override
    public int getValue() {
        return this.value;
    }

    @Override
    public String getLabel() {
        return this.label;
    }

    public static StateEnum parse(final int value) {
        StateEnum result = null;
        switch (value) {
        case 1:
            result = StateEnum.Invalid;
            break;
        case 2:
            result = StateEnum.Valid;
            break;
        }
        return result;
    }

    public static List<StateEnum> getEnumValues() {
        return Arrays.asList(StateEnum.values());
    }
}
